#!/bin/bash -x
#
# (or use sh -x to see what is going on)
#
# /*
#  *
#  *  This program is free software: you can redistribute it and/or modify
#  *  it under the terms of the GNU General Public License as published by
#  *  the Free Software Foundation, either version 3 of the License, or
#  *  (at your option) any later version.
#  *
#  *  This program is distributed in the hope that it will be useful,
#  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  *  GNU General Public License for more details.
#  *
#  *  You should have received a copy of the GNU General Public License
#  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#  *
#  *  These are the four essential freedoms with GNU GPL software:
#  *  1: freedom to run the program, for any purpose
#  *  2: freedom to study how the program works, and change it to make it do what you wish
#  *  3: freedom to redistribute copies to help your Free Software girlfriends and friends
#  *  4: freedom to distribute copies of your modified versions to your Free Software girlfriends and friends
#  *
#  *   ,           ,
#  *  /             \
#  * ((__-^^-,-^^-__))
#  * `-_---'  `---_-'
#  *  `--|o`   'o|--'
#  *      \  `  /
#  *       ): :(
#  *       :o_o:
#  *        "-"
#  */
#

$HOME/mygcc/bin/gcc --version

# recommended way to do this and CC CFLAGS will not be added to shell environment
# only newest gcc-4.9.2 software http://gcc.gnu.org
./configure CC=$HOME/mygcc/bin/gcc CFLAGS="-Wall -pedantic -O2"

#./configure CC=$HOME/mygcc/bin/gcc CFLAGS="-Wall -O2 "

$HOME/mygcc/bin/gcc --version

exit 0

-fdump-final-insns[=file]
    Dump the final internal representation (RTL) to file. If the optional argument is omitted (or if file is .), the name of the dump file is determined by appending .gkd to the compilation output file name. 

-fdump-rtl-pass
-fdump-rtl-pass=filename
    Says to make debugging dumps during compilation at times specified by letters. This is used for debugging the RTL-based passes of the compiler. The file names for most of the dumps are made by appending a pass number and a word to the dumpname, and the files are created in the directory of the output file. In case of =filename option, the dump is output on the given file instead of the pass numbered dump files. Note that the pass number is computed statically as passes get registered into the pass manager. Thus the numbering is not related to the dynamic order of execution of passes. In particular, a pass installed by a plugin could have a number over 200 even if it executed quite early. dumpname is generated from the name of the output file, if explicitly specified and it is not an executable, otherwise it is the basename of the source file. These switches may have different effects when -E is used for preprocessing.

    Debug dumps can be enabled with a -fdump-rtl switch or some -d option letters. Here are the possible letters for use in pass and letters, and their meanings:

    -fdump-rtl-alignments
        Dump after branch alignments have been computed.
    -fdump-rtl-asmcons
        Dump after fixing rtl statements that have unsatisfied in/out constraints.
    -fdump-rtl-auto_inc_dec
        Dump after auto-inc-dec discovery. This pass is only run on architectures that have auto inc or auto dec instructions.
    -fdump-rtl-barriers
        Dump after cleaning up the barrier instructions.
    -fdump-rtl-bbpart
        Dump after partitioning hot and cold basic blocks.
    -fdump-rtl-bbro
        Dump after block reordering.
    -fdump-rtl-btl1
    -fdump-rtl-btl2
        -fdump-rtl-btl1 and -fdump-rtl-btl2 enable dumping after the two branch target load optimization passes.
    -fdump-rtl-bypass
        Dump after jump bypassing and control flow optimizations.
    -fdump-rtl-combine
        Dump after the RTL instruction combination pass.
    -fdump-rtl-compgotos
        Dump after duplicating the computed gotos.
    -fdump-rtl-ce1
    -fdump-rtl-ce2
    -fdump-rtl-ce3
        -fdump-rtl-ce1, -fdump-rtl-ce2, and -fdump-rtl-ce3 enable dumping after the three if conversion passes.
    -fdump-rtl-cprop_hardreg
        Dump after hard register copy propagation.
    -fdump-rtl-csa
        Dump after combining stack adjustments.
    -fdump-rtl-cse1
    -fdump-rtl-cse2
        -fdump-rtl-cse1 and -fdump-rtl-cse2 enable dumping after the two common subexpression elimination passes.
    -fdump-rtl-dce
        Dump after the standalone dead code elimination passes.
    -fdump-rtl-dbr
        Dump after delayed branch scheduling.
    -fdump-rtl-dce1
    -fdump-rtl-dce2
        -fdump-rtl-dce1 and -fdump-rtl-dce2 enable dumping after the two dead store elimination passes.
    -fdump-rtl-eh
        Dump after finalization of EH handling code.
    -fdump-rtl-eh_ranges
        Dump after conversion of EH handling range regions.
    -fdump-rtl-expand
        Dump after RTL generation.
    -fdump-rtl-fwprop1
    -fdump-rtl-fwprop2
        -fdump-rtl-fwprop1 and -fdump-rtl-fwprop2 enable dumping after the two forward propagation passes.
    -fdump-rtl-gcse1
    -fdump-rtl-gcse2
        -fdump-rtl-gcse1 and -fdump-rtl-gcse2 enable dumping after global common subexpression elimination.
    -fdump-rtl-init-regs
        Dump after the initialization of the registers.
    -fdump-rtl-initvals
        Dump after the computation of the initial value sets.
    -fdump-rtl-into_cfglayout
        Dump after converting to cfglayout mode.
    -fdump-rtl-ira
        Dump after iterated register allocation.
    -fdump-rtl-jump
        Dump after the second jump optimization.
    -fdump-rtl-loop2
        -fdump-rtl-loop2 enables dumping after the rtl loop optimization passes.
    -fdump-rtl-mach
        Dump after performing the machine dependent reorganization pass, if that pass exists.
    -fdump-rtl-mode_sw
        Dump after removing redundant mode switches.
    -fdump-rtl-rnreg
        Dump after register renumbering.
    -fdump-rtl-outof_cfglayout
        Dump after converting from cfglayout mode.
    -fdump-rtl-peephole2
        Dump after the peephole pass.
    -fdump-rtl-postreload
        Dump after post-reload optimizations.
    -fdump-rtl-pro_and_epilogue
        Dump after generating the function prologues and epilogues.
    -fdump-rtl-sched1
    -fdump-rtl-sched2
        -fdump-rtl-sched1 and -fdump-rtl-sched2 enable dumping after the basic block scheduling passes.
    -fdump-rtl-ree
        Dump after sign/zero extension elimination.
    -fdump-rtl-seqabstr
        Dump after common sequence discovery.
    -fdump-rtl-shorten
        Dump after shortening branches.
    -fdump-rtl-sibling
        Dump after sibling call optimizations.
    -fdump-rtl-split1
    -fdump-rtl-split2
    -fdump-rtl-split3
    -fdump-rtl-split4
    -fdump-rtl-split5
        These options enable dumping after five rounds of instruction splitting.
    -fdump-rtl-sms
        Dump after modulo scheduling. This pass is only run on some architectures.
    -fdump-rtl-stack
        Dump after conversion from GCC's “flat register file” registers to the x87's stack-like registers. This pass is only run on x86 variants.
    -fdump-rtl-subreg1
    -fdump-rtl-subreg2
        -fdump-rtl-subreg1 and -fdump-rtl-subreg2 enable dumping after the two subreg expansion passes.
    -fdump-rtl-unshare
        Dump after all rtl has been unshared.
    -fdump-rtl-vartrack
        Dump after variable tracking.
    -fdump-rtl-vregs
        Dump after converting virtual registers to hard registers.
    -fdump-rtl-web
        Dump after live range splitting.
    -fdump-rtl-regclass
    -fdump-rtl-subregs_of_mode_init
    -fdump-rtl-subregs_of_mode_finish
    -fdump-rtl-dfinit
    -fdump-rtl-dfinish
        These dumps are defined but always produce empty files.
    -da
    -fdump-rtl-all
        Produce all the dumps listed above. 


